package com.sjgtw.cloud.web.rainfallRange.service.impl;

import java.util.List;

import com.sjgtw.cloud.common.core.utils.DateUtils;
import com.sjgtw.cloud.web.rainfallRange.domain.RainfallRange;
import com.sjgtw.cloud.web.rainfallRange.mapper.RainfallRangeMapper;
import com.sjgtw.cloud.web.rainfallRange.service.IRainfallRangeService;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.stereotype.Service;


/**
 * 雨量警戒值Service业务层处理
 * 
 * @author ruoyi
 * @date 2024-03-17
 */
@Service
public class RainfallRangeServiceImpl implements IRainfallRangeService
{
    @Autowired
    private RainfallRangeMapper rainfallRangeMapper;

    /**
     * 查询雨量警戒值
     * 
     * @param id 雨量警戒值主键
     * @return 雨量警戒值
     */
    @Override
    public RainfallRange selectRainfallRangeById(Long id)
    {
        return rainfallRangeMapper.selectRainfallRangeById(id);
    }

    /**
     * 查询雨量警戒值列表
     * 
     * @param rainfallRange 雨量警戒值
     * @return 雨量警戒值
     */
    @Override
    public List<RainfallRange> selectRainfallRangeList(RainfallRange rainfallRange)
    {
        return rainfallRangeMapper.selectRainfallRangeList(rainfallRange);
    }

    /**
     * 新增雨量警戒值
     * 
     * @param rainfallRange 雨量警戒值
     * @return 结果
     */
    @Override
    public int insertRainfallRange(RainfallRange rainfallRange)
    {
        rainfallRange.setCreateTime(DateUtils.getNowDate());
        return rainfallRangeMapper.insertRainfallRange(rainfallRange);
    }

    /**
     * 修改雨量警戒值
     * 
     * @param rainfallRange 雨量警戒值
     * @return 结果
     */
    @Override
    public int updateRainfallRange(RainfallRange rainfallRange)
    {
        rainfallRange.setUpdateTime(DateUtils.getNowDate());
        return rainfallRangeMapper.updateRainfallRange(rainfallRange);
    }

    /**
     * 批量删除雨量警戒值
     * 
     * @param ids 需要删除的雨量警戒值主键
     * @return 结果
     */
    @Override
    public int deleteRainfallRangeByIds(Long[] ids)
    {
        return rainfallRangeMapper.deleteRainfallRangeByIds(ids);
    }

    /**
     * 删除雨量警戒值信息
     * 
     * @param id 雨量警戒值主键
     * @return 结果
     */
    @Override
    public int deleteRainfallRangeById(Long id)
    {
        return rainfallRangeMapper.deleteRainfallRangeById(id);
    }
}
